<template>
	<view class="content">
		<view class="box bgfff radius10">
			<view class="box-top flex-ac-jc cfff f42">
				<text class="title">{{dataObj.title}}</text>
			</view>
			<view class="box-con flex-dc-ac">
				<view class="code radius15">
					<!-- <image :src="dataObj.image" mode="widthFix" style="height: auto;"></image> -->
					 <gui-imageLoading width="300" :src="dataObj.image" mode="widthFix" :showOpacity="true"></gui-imageLoading>
				</view>
				<text class="f30 c666">提示:微信扫码申请</text>
				<text class="f30 c666">(10分钟内,且只能识别一次)</text>
				<text class="f24 c666">失效时间:{{dataObj.endTime}}</text>
				<view class="saveBtn" @tap="handleLook(true)">立即刷新</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				menuId: '',
				dataObj:{}
			}
		},
		onLoad(options) {
			this.menuId = options.id
			if (options.id) {
				this.handleLook()
			}
		},
		methods: {
			handleLook(reflash) {
				let query = {
					menuId: this.menuId
				}
				if(reflash){
					query.type = 1
				}
				this.$http.post('/api/home/viewApplication',query).then(res => {
					let result = res.data
					console.log('查看应用', result)
					this.dataObj = result
				})
			}
		}
	}
</script>

<style lang="less">
	.content {
		padding: 67rpx 40rpx;
	}

	.box-top {
		background: url(../../static/index/code_top.png) no-repeat;
		background-size: 100% 100%;
		height: 200rpx;

		.title {
			position: relative;
			top: -20rpx;
		}
	}

	.box-con {
		padding: 45rpx 110rpx;

		.code {
			width: 100%;
			border: 4px solid #707070;
			padding: 30rpx;
			margin-bottom: 50rpx;
			min-height: 340rpx;
		}

		.f30 {
			margin-bottom: 6rpx;
		}

		.saveBtn {
			width: 325rpx;
			height: 64rpx;
			margin-top: 45rpx;
			font-size: 24rpx;
		}
	}
</style>